﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using iLangl.Transport;
using System.IO;
using iLangl.Model;
using iLangl.LanguageWire.Actions;
using iLangl.Transport.Communication;
using iLangl.StateMachine;
using iLangl.Customer.Actions;
using iLangl.Plugin;
using iLangl.Security;
using iLangl.Customer;
using iLangl.BusinessModel;
using iLangl.Tests.SerializationFixture;
using iLangl.BusinessModel.Managers;
using iLangl.LanguageWire.Managers;
using iLangl.LanguageWire;

namespace iLangl.Tests.PluginFixture
{
	[TestClass]
	public class RegistrationTPPluginTest : RegistrationPluginValidationTest
	{

		[TestMethod]
		public void RegistrationTPPlugin()
		{
			//Setup customer facade
			SwitchToCustomerSide();

			String licenseKey = PluginManagerLW.Instance.RegisterPluginLicense();

			Assert.IsFalse(string.IsNullOrEmpty(licenseKey));

			TranslationProviderManager.Instance.SetDefaultTranslationProvider(LWCompanyInfoConfiguration.Instance.CompanyId);

		}

		//public PluginRegistration GetTPPluginRegistration()
		//{
		//    //Prepare Request
		//    PluginRegistration request = new PluginRegistration();

		//    request.PluginId = "B6C10D99-4E9A-4404-BEF5-B77C9EC7BE64";
		//    request.PluginName = "iLangl LanguageWire Plugin";
		//    request.PluginVersion = "1";
		//    request.PushURIAddress = "http://localhost/languagewireAPI";
		//    request.SessionId = new PluginAuthenticationService().Authenticate("test");

		//    request.Company = CompanyValidationTest.GetCompany();
		//    request.Company.Id = TestSettings.LanguageWireCompanyId;
		//    request.Company.Name = "LanguageWire";

		//    List<Contact> contacts = new List<Contact>();
		//    Contact contact = new Contact();
		//    contact.Id = "4a893051-8263-4ec5-b344-23612404feaf";
		//    contact.Company = request.Company;
		//    contact.Email = "test1@test.email";
		//    contact.FirstName = "Thor A.";
		//    contact.LastName = "Angelo";
		//    contact.Phone = "(xxx)123-34-34";
		//    contact.Title = "CEO";

		//    contacts.Add(contact);

		//    contact = new Contact();
		//    contact.Id = "768C1256-70C8-432C-B99B-6937AA588BBF";
		//    contact.Company = request.Company;
		//    contact.Email = "aksel@test.email";
		//    contact.FirstName = "Aksel";
		//    contact.LastName = "Moller J.";
		//    contact.Phone = "(xxx)123-14-35";
		//    contact.Title = "Technical Director";
		//    contacts.Add(contact);

		//    request.Company.Contacts = contacts.ToArray();

		//    request.PrimaryContactId = request.Company.Contacts[0].Id;

		//    return request;
		//}
	
	}
}
